/**
 ********************************************************************
 * @author roocket
 * @file    main.c
 * @version V0.0.0
 * @date    2024/3/22
 * @brief   This file is to indicate main functions. 
 * @attention Code file rules:
 * rule: file encoding use UTF8;
 * rule: max line length 120 characters;
 * rule: line separator \r\n;
 * rule: use clion auto code format tool.
 */
#include "client.h"
#include "server.h"

int main(int argc, char **argv)
{
    int err = -1;
    int fd = -1;

    printf("welcome to socket\n");
    #if 0
    fd = server_init_socket(SOCKET_SERVER_ADDRESS, SOCKET_SERVER_PORT);
    if (-1 == fd)
        printf("failed to init socket for server\n");
    err = server_epoll_handle_data(fd);
    if (-1 == err)
        printf("failed to set epoll for handling data\n");

    #endif
    #if 0
    fd = client_init_socket(SOCKET_SERVER_ADDRESS, SOCKET_SERVER_PORT);
    if (-1 == fd)
        printf("failed to init socket for client\n");

    char buffer[32] = "helloworld";

    err = client_set_data(fd, buffer, strlen(buffer));
    if (-1 == err)
        printf("failed to send data to server\n");
    #endif
    return 0;
}

